package com.tedu.pojo;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 响应标准对象设计(用于封装服务端响应到客户端的数据)
 */
@Data
@NoArgsConstructor
public class JsonResult {//ResultResult
    private Integer state=1;
    private String message="ok";
    private Object data;
    public JsonResult(String message){
        this.message=message;
    }
    public JsonResult(Object data){
        this.data=data;
    }
    public JsonResult(Throwable e){
        this.state=0;
        this.message=e.getMessage();
    }
}